package per.zqx.msrw.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import per.zqx.msrw.annos.Master;
import per.zqx.msrw.annos.Slave;
import per.zqx.msrw.dao.UserInfoDao;
import per.zqx.msrw.domain.UserInfo;
import per.zqx.msrw.service.UserInfoService;

/**
 * UserInfoServiceImpl,
 *
 * @author Sa, Zhang 2021-12-28 15:34
 */
@Service
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    UserInfoDao userInfoDao;

    @Override
//    @Slave // get方法被AOP切，可以省略
    public UserInfo get(Integer id) {
        return userInfoDao.selectById(id);
    }

    @Override
    @Master // 同样会被切，可以省略
    public void insert(UserInfo userInfo) {
        userInfoDao.insert(userInfo);
    }
}
